package cn.devices.mapper;

import cn.devices.entity.TbAuthDm;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 * 部门权限表 Mapper 接口
 * </p>
 *
 * @author 秋水浮萍
 * @since 2021-02-07
 */
@Repository
public interface TbAuthDmMapper {

    @Insert("insert into  tb_auth_dm(type_id, dep_code, authorize_time) " +
            "VALUE (#{typeId},#{depCode},#{authorizeTime})")
    int tbAuthDmAdd(TbAuthDm tbAuthDm);

    @Delete("delete from tb_auth_dm where type_id=#{typeId} and dep_code=#{deCode}")
    int tbAuthDmDelete(String typeId,String deCode);

    @Select("select *\n" +
            "from tb_auth_dm\n" +
            "where dep_code = #{depCode}"
            )
    List<TbAuthDm> tbAuthDmList(String depCode);



}
